#ifndef DEFINE_TEXT2_H
#define DEFINE_TEXT2_H
#include <vector>
#include "Rect.h"
#include "Matrix.h"
#include "TextRecord.h"
#include "Defination.h"

namespace swfstream {
class DefineText2: public Defination {
public:
	//uint font(){return CharacterID;}
	//uint16 CharacterID;///< ID for this text character.
	Rect* TextBounds; ///< Bounds of the text.
	Matrix* TextMatrix; ///< Transformation matrix.
	uint8 GlyphBits; ///< Bits in each glyph index.
	uint8 AdvanceBits; ///< Bits in each advance value.
	//struct text_record* TextRecords;///< Text records.
	std::vector<TextRecord*>* TextRecords; ///< Text records.
	uint8 EndOfRecordsFlag; ///< Must be 0.
	static DefineText2* from_file(FILE*f);
	void print();
	virtual TiXmlElement* toTiXmlElement();

	/*
	 size_t size_in_file(){
	 return 2+TextBounds->size_in_file()+TextMatrix->size_in_file()+1+1;
	 }
	 */
};
}
#endif
